feat(core): v0.2 failure detection rules — 7 new rules - #70
Merged
Conversation
Add 7 new failure detection rules to packages/toolkit/src/core/detection.ts: - TIMEOUT_NO_HEARTBEAT: no Heartbeat within 2x expected interval after BootNotification - METER_VALUE_GAP: no MeterValues during a completed transaction - INVALID_STOP_REASON: StopTransaction with non-standard reason code - UNEXPECTED_START: StartTransaction without preceding BootNotification or Authorize - STATUS_TRANSITION_VIOLATION: illegal connector status transition per OCPP 1.6 - DIAGNOSTICS_FAILURE: DiagnosticsStatusNotification with failure status - FIRMWARE_UPDATE_FAILURE: FirmwareStatusNotification with failure status Update FailureCode type with 7 new codes. Add suggested steps and severity for each. Add 18 unit tests (2-3 per rule). Fix existing fixtures: add Heartbeat messages to normal-session, connector-fault, station-offline, and unexpected-stop-reason fixtures so new TIMEOUT_NO_HEARTBEAT rule does not false-positive. Fix connector-fault stop reason from 'Faulted' (invalid) to 'Other'. Closes #59
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expands failure detection from 3 rules to 10 by adding 7 new detection rules.
New Rules
TIMEOUT_NO_HEARTBEATMETER_VALUE_GAPINVALID_STOP_REASONUNEXPECTED_STARTSTATUS_TRANSITION_VIOLATIONDIAGNOSTICS_FAILUREFIRMWARE_UPDATE_FAILUREChanges
packages/toolkit/src/core/types.ts— FailureCode type updated with 7 new codespackages/toolkit/src/core/detection.ts— 7 new detection functions + suggested steps + severitypackages/toolkit/src/core/detection.test.ts— 18 new tests (2-3 per rule)Verification
pnpm test— 214/214 tests pass (196 original + 18 new)pnpm build— cleanpnpm lint— cleanpnpm typecheck— cleanpnpm format:check— cleanCloses #59